package org.peerjs.configuration;

public class PeerRtcConfiguration {
    public final IceServerOption[] iceServers;

    private PeerRtcConfiguration(IceServerOption[] iceServers) {
        this.iceServers = iceServers;

    }

    /*
            TODO:
                implement other configuration fields
                bundlePolicy,
                rtcpMuxPolicy,
                certificate,
                tcpCandidatePolicy,

                ...
             */
    public static Builder newBuilder() {
        return new Builder(null);
    }

    public static class Builder {
        private final PeerOptions.Builder peerOptionBuilder;
        private IceServerOption[] iceServers;

        Builder(PeerOptions.Builder peerOptionBuilder) {
            this.peerOptionBuilder = peerOptionBuilder;
        }

        public Builder iceServers(IceServerOption... iceServerOptions) {
            this.iceServers = iceServerOptions;
            return this;
        }

        public PeerOptions.Builder peerOptionBuilder() {
            this.peerOptionBuilder.rtcConfiguration = new PeerRtcConfiguration(iceServers);
            return this.peerOptionBuilder;
        }
    }
}
